<?php
class BasicConfigurationForm extends Zend_Form
{
	public function init()
	{
		$id = $this->createElement('hidden','ID');
		$id->setDecorators(array(
								'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff;text-align:left')),
								//array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr'))));
		
		$name = $this->createElement('text','name');
		$name->setLabel('Company Name:');
		
		$description = $this->createElement('textarea','description');
		$description->setLabel('Description:')
					->setAttrib('rows',12)
					->setAttrib('cols',40)
					->setAttrib('style','width:90%');
					
		$url = $this->createElement('text','url');
		$url->setLabel('URL:')
				->setDescription('<font size = "1"><br>Your company url.</font>');
				
		$logo = $this->createElement('file','logo');
		$logo->setLabel('Logo');
		
		$save = $this->createElement('submit','save');
		$save->setLabel('save')
				->setDecorators(array(
							'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff;text-align:center','openOnly'=>true,'colspan'=>2,'align'=>'center')),
								//array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr','openOnly'=>true))
				));
				
		$cancel = $this->createElement('button','cancel');
		$cancel->setLabel('Cancel')
				->setDecorators(array(
							'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff','closeOnly'=>true)),
								//array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr','closeOnly'=>true))
				));
				
		$this->addElements(array(
						$name,
						$description,
						$url,
						$logo,
						$id,
						$save,
						$cancel
		));
		
		$this->setElementDecorators(array(
								'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff;text-align:left')),
								array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr'))),
								array('name', 'description', 'url', 'logo')
								);
								
		$this->addDecorators(array(
				'FormElements',
				array('HtmlTag', array('tag' => 'table','width'=>'100%','cellspacing'=>'0','border'=>'0','class'=>'pform')),
				'Form'
		));
	}
}